﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Noea.TogSim.Model.Interfaces
{
    /// <summary>
    /// Eventhandler for ISensor
    /// </summary>
    /// <param name="sensor">Handled sensor</param>
    /// <param name="e">Event</param>
    public delegate void SensorHandler(ISensor sensor, ISensorEventArgs e);

    /// <summary>
    ///	To be implemented by sensors. Sensors registrates events on the _trackRows, ie. that it is blocked 
    /// </summary>
    public interface ISensor
    {
        /// <summary>
        /// Identification of the sensor
        /// </summary>
        int Id { get; }

        /// <summary>
        /// Track where the sensor is mounted. 
        /// </summary>
        Object Value { get; set; }
        /// <summary>
        /// OnChange event, to fired when the state changes
        /// </summary>
        event SensorHandler OnChange;
    }

    public interface ISensorEventArgs
    {
        ISensor Sensor { get; }
        Object OldValue { get; }
        Object NewValue { get; }
    }
}
